/*
 * SuperIndexRecord.java
 *
 * Copyright(c) 2010
 * Michael Kroez
 * kroez@studiorutton.de
 *
 * All rights reserved.
 *
 * $Id$
 * 
 */

package de.studiorutton.gerengdic.databaseaccess.records;

import java.util.Locale;

public class SuperIndexRecord {
	public final static byte SUPER_INDEX_RECORD_HEADER = 0x03;
	private String key;
	private int index;

	// [ byte SUPER_INDEX_RECORD_HEADER | 4bytes keySize | n bytes key | 4bytes indexStarting ]
	public SuperIndexRecord(String key, int index ) {
		this.key = key;
		this.index = index;
	}

	public String getKey() {
		return key;
	}

	public String getKeyComparable() {
		return key.toLowerCase(Locale.GERMAN).replace("ä", "ae")
				.replace("ö", "oe").replace("ü", "ue");
	}

	public int getIndex() {
		return index;
	}
}
